/**************************************************************************
*   Copyright (C) 2009 Chernov Dmitry                                     *
*   diman4ik.chernov@gmail.com                                            *
*                                                                         *
*   This program is free software; you can redistribute it and/or modify  *
*   it under the terms of the GNU General Public License as published by  *
*   the Free Software Foundation; either version 2 of the License, or     *
*   (at your option) any later version.                                   *
*                                                                         *
*   This program is distributed in the hope that it will be useful,       *
*   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
*   GNU General Public License for more details.                          *
*                                                                         *
*   You should have received a copy of the GNU General Public License     *
*   along with this program; if not, write to the                         *
*   Free Software Foundation, Inc.,                                       *
*   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
***************************************************************************/

#ifndef KORNERS_GRAPHICS_ITEMS
#define KORNERS_GRAPHICS_ITEMS

#include <QGraphicsPixmapItem>

class QPoint;

class KornersGraphicsItem : public QGraphicsPixmapItem
{
public:
    KornersGraphicsItem( QPixmap pm ) : QGraphicsPixmapItem(pm) 
    {}

    KornersGraphicsItem()
    {}

    // enable use of qgraphicsitem_cast
    enum { Type = UserType + 1 };
    virtual int type() const { return Type; }

    void setPos(const QPoint& newPos)
    {
        position = newPos;
    }

    const QPoint& getPos() const
    {
	return position;
    }
private:
    QPoint position;
};

class KornersCapItem : public KornersGraphicsItem
{
public:
    enum owner
    {
        player = 1,
        opponent = 2,
    };

    KornersCapItem( QPixmap pm, owner own ) : KornersGraphicsItem(pm)
    {
        m_whos = own;
    }

    enum { Type = UserType + 2 };
    virtual int type() const { return Type; }
 
    owner whos() const
    {
        return m_whos;
    }
private:
    owner m_whos;
};

class KornersHighlightItem : public KornersGraphicsItem
{
public:
    enum { Type = UserType + 3 };
    virtual int type() const { return Type; }
};

#endif
